package com.lionli.redisson.demo.controller;

import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试类
 *
 * @author Lion Li
 */
@RestController
public class DemoController {

    @Autowired
    private RedissonClient redissonClient;

    @GetMapping("/add")
    public String add(String str) {
        redissonClient.getBucket("demo").set(str);
        return redissonClient.<String>getBucket("demo").get();
    }
}
